home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Technology Seed / Jan. '98 ATS.toast / QuickTime™ 3.0b11 / QTPublicInterfaces / AIncludes / Components.a next >
Encoding:
Text File  |  1998-01-12  |  26.3 KB  |  904 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Components.a
  3. ;
  4. ;    Contains:    QuickTime interfaces
  5. ;
  6. ;    Version:    Technology:    
  7. ;                Release:    QuickTime 3.0 Beta
  8. ;
  9. ;    Copyright:    © 1990-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  19. __COMPONENTS__ SET 1
  20.  
  21.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  22.     include 'Errors.a'
  23.     ENDIF
  24.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  25.     include 'MacTypes.a'
  26.     ENDIF
  27.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  28.     include 'MixedMode.a'
  29.     ENDIF
  30.     IF &TYPE('__CODEFRAGMENTS__') = 'UNDEFINED' THEN
  31.     include 'CodeFragments.a'
  32.     ENDIF
  33.  
  34.  
  35. kAppleManufacturer                EQU        'appl'                ; Apple supplied components 
  36. kComponentResourceType            EQU        'thng'                ; a components resource type 
  37. kComponentAliasResourceType        EQU        'thga'                ; component alias resource type 
  38.  
  39. kAnyComponentType                EQU        0
  40. kAnyComponentSubType            EQU        0
  41. kAnyComponentManufacturer        EQU        0
  42. kAnyComponentFlagsMask            EQU        0
  43.  
  44. cmpWantsRegisterMessage            EQU        $80000000
  45. cmpIsComponentAlias                EQU        $10000000
  46.  
  47. kComponentOpenSelect            EQU        -1                    ; ComponentInstance for this open 
  48. kComponentCloseSelect            EQU        -2                    ; ComponentInstance for this close 
  49. kComponentCanDoSelect            EQU        -3                    ; selector # being queried 
  50. kComponentVersionSelect            EQU        -4                    ; no params 
  51. kComponentRegisterSelect        EQU        -5                    ; no params 
  52. kComponentTargetSelect            EQU        -6                    ; ComponentInstance for top of call chain 
  53. kComponentUnregisterSelect        EQU        -7                    ; no params 
  54. kComponentGetMPWorkFunctionSelect EQU    -8                    ; some params 
  55. ;  Component Resource Extension flags 
  56.  
  57. componentDoAutoVersion            EQU        $01
  58. componentWantsUnregister        EQU        $02
  59. componentAutoVersionIncludeFlags EQU    $04
  60. componentHasMultiplePlatforms    EQU        $08
  61. componentLoadResident            EQU        $10
  62.  
  63.  
  64. ;  Set Default Component flags 
  65.  
  66. defaultComponentIdentical        EQU        0
  67. defaultComponentAnyFlags        EQU        1
  68. defaultComponentAnyManufacturer    EQU        2
  69. defaultComponentAnySubType        EQU        4
  70. defaultComponentAnyFlagsAnyManufacturer EQU 3
  71. defaultComponentAnyFlagsAnyManufacturerAnySubType EQU 7
  72. ;  RegisterComponentResource flags 
  73.  
  74. registerComponentGlobal            EQU        1
  75. registerComponentNoDuplicates    EQU        2
  76. registerComponentAfterExisting    EQU        4
  77. registerComponentAliasesOnly    EQU        8
  78.  
  79.  
  80. unresolvedComponentDLLErr        EQU        -3004
  81. ComponentDescription    RECORD 0
  82. componentType             ds.l    1                ; offset: $0 (0)        ;  A unique 4-byte code indentifying the command set 
  83. componentSubType         ds.l    1                ; offset: $4 (4)        ;  Particular flavor of this instance 
  84. componentManufacturer     ds.l    1                ; offset: $8 (8)        ;  Vendor indentification 
  85. componentFlags             ds.l    1                ; offset: $C (12)        ;  8 each for Component,Type,SubType,Manuf/revision 
  86. componentFlagsMask         ds.l    1                ; offset: $10 (16)        ;  Mask for specifying which flags to consider in search, zero during registration 
  87. sizeof                     EQU *                    ; size:   $14 (20)
  88.                         ENDR
  89.  
  90. ResourceSpec            RECORD 0
  91. resType                     ds.l    1                ; offset: $0 (0)        ;  4-byte code     
  92. resID                     ds.w    1                ; offset: $4 (4)        ;               
  93. sizeof                     EQU *                    ; size:   $6 (6)
  94.                         ENDR
  95. ComponentResource        RECORD 0
  96. cd                         ds        ComponentDescription ; offset: $0 (0)    ;  Registration parameters 
  97. component                 ds        ResourceSpec    ; offset: $14 (20)        ;  resource where Component code is found 
  98. componentName             ds        ResourceSpec    ; offset: $1A (26)        ;  name string resource 
  99. componentInfo             ds        ResourceSpec    ; offset: $20 (32)        ;  info string resource 
  100. componentIcon             ds        ResourceSpec    ; offset: $26 (38)        ;  icon resource 
  101. sizeof                     EQU *                    ; size:   $2C (44)
  102.                         ENDR
  103. ; typedef struct ComponentResource *    ComponentResourcePtr
  104.  
  105. ; typedef ComponentResourcePtr *        ComponentResourceHandle
  106.  
  107. ComponentPlatformInfo    RECORD 0
  108. componentFlags             ds.l    1                ; offset: $0 (0)        ;  flags of Component 
  109. component                 ds        ResourceSpec    ; offset: $4 (4)        ;  resource where Component code is found 
  110. platformType             ds.w    1                ; offset: $A (10)        ;  gestaltSysArchitecture result 
  111. sizeof                     EQU *                    ; size:   $C (12)
  112.                         ENDR
  113. ComponentResourceExtension RECORD 0
  114. componentVersion         ds.l    1                ; offset: $0 (0)        ;  version of Component 
  115. componentRegisterFlags     ds.l    1                ; offset: $4 (4)        ;  flags for registration 
  116. componentIconFamily         ds.w    1                ; offset: $8 (8)        ;  resource id of Icon Family 
  117. sizeof                     EQU *                    ; size:   $A (10)
  118.                         ENDR
  119. ComponentPlatformInfoArray RECORD 0
  120. count                     ds.l    1                ; offset: $0 (0)
  121. platformArray             ds        ComponentPlatformInfo ; offset: $4 (4) <-- really an array of length one
  122. sizeof                     EQU *                    ; size:   $10 (16)
  123.                         ENDR
  124. ExtComponentResource    RECORD 0
  125. cd                         ds        ComponentDescription ; offset: $0 (0)    ;  registration parameters 
  126. component                 ds        ResourceSpec    ; offset: $14 (20)        ;  resource where Component code is found 
  127. componentName             ds        ResourceSpec    ; offset: $1A (26)        ;  name string resource 
  128. componentInfo             ds        ResourceSpec    ; offset: $20 (32)        ;  info string resource 
  129. componentIcon             ds        ResourceSpec    ; offset: $26 (38)        ;  icon resource 
  130. componentVersion         ds.l    1                ; offset: $2C (44)        ;  version of Component 
  131. componentRegisterFlags     ds.l    1                ; offset: $30 (48)        ;  flags for registration 
  132. componentIconFamily         ds.w    1                ; offset: $34 (52)        ;  resource id of Icon Family 
  133. count                     ds.l    1                ; offset: $36 (54)        ;  elements in platformArray 
  134. platformArray             ds        ComponentPlatformInfo ; offset: $3A (58) <-- really an array of length one
  135. sizeof                     EQU *                    ; size:   $46 (70)
  136.                         ENDR
  137. ComponentAliasResource    RECORD 0
  138. cr                         ds        ComponentResource ; offset: $0 (0)        ;  Registration parameters 
  139. aliasCD                     ds        ComponentDescription ; offset: $2C (44) ;  component alias description 
  140. sizeof                     EQU *                    ; size:   $40 (64)
  141.                         ENDR
  142. ;   Structure received by Component:        
  143. ComponentParameters        RECORD 0
  144. flags                     ds.b    1                ; offset: $0 (0)        ;  call modifiers: sync/async, deferred, immed, etc 
  145. paramSize                 ds.b    1                ; offset: $1 (1)        ;  size in bytes of actual parameters passed to this call 
  146. what                     ds.w    1                ; offset: $2 (2)        ;  routine selector, negative for Component management calls 
  147. params                     ds.l    1                ; offset: $4 (4) <-- really an array of length one ;  actual parameters for the indicated routine 
  148. sizeof                     EQU *                    ; size:   $8 (8)
  149.                         ENDR
  150. ComponentRecord            RECORD 0
  151. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  152. sizeof                     EQU *                    ; size:   $4 (4)
  153.                         ENDR
  154. ; typedef struct ComponentRecord *        Component
  155.  
  156. ComponentInstanceRecord    RECORD 0
  157. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  158. sizeof                     EQU *                    ; size:   $4 (4)
  159.                         ENDR
  160. ; typedef struct ComponentInstanceRecord * ComponentInstance
  161.  
  162. RegisteredComponentRecord RECORD 0
  163. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  164. sizeof                     EQU *                    ; size:   $4 (4)
  165.                         ENDR
  166. ; typedef struct RegisteredComponentRecord * RegisteredComponentPtr
  167.  
  168. RegisteredComponentInstanceRecord RECORD 0
  169. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  170. sizeof                     EQU *                    ; size:   $4 (4)
  171.                         ENDR
  172. ; typedef struct RegisteredComponentInstanceRecord * RegisteredComponentInstancePtr
  173.  
  174. ; typedef long                             ComponentResult
  175.  
  176.  
  177. platform68k                        EQU        1                    ; platform type (response from gestaltSysArchitecture) 
  178. platformPowerPC                    EQU        2
  179. platformInterpreted                EQU        3
  180. platformWin32                    EQU        4
  181.  
  182. mpWorkFlagDoWork                EQU        $01
  183. mpWorkFlagDoCompletion            EQU        $02
  184. mpWorkFlagCopyWorkBlock            EQU        $04
  185. mpWorkFlagDontBlock                EQU        $08
  186. mpWorkFlagGetProcessorCount        EQU        $10
  187. mpWorkFlagGetIsRunning            EQU        $40
  188. ComponentMPWorkFunctionHeaderRecord RECORD 0
  189. headerSize                 ds.l    1                ; offset: $0 (0)
  190. recordSize                 ds.l    1                ; offset: $4 (4)
  191. workFlags                 ds.l    1                ; offset: $8 (8)
  192. processorCount             ds.w    1                ; offset: $C (12)
  193. unused                     ds.b    1                ; offset: $E (14)
  194. isRunning                 ds.b    1                ; offset: $F (15)
  195. sizeof                     EQU *                    ; size:   $10 (16)
  196.                         ENDR
  197. ; typedef struct ComponentMPWorkFunctionHeaderRecord * ComponentMPWorkFunctionHeaderRecordPtr
  198.  
  199. ;    The parameter list for each ComponentFunction is unique. It is 
  200. ;    therefore up to users to create the appropriate procInfo for their 
  201. ;    own ComponentFunctions where necessary.
  202. ;
  203.  
  204. ; typedef UniversalProcPtr                 ComponentFunctionUPP
  205.  
  206.  
  207. ; ********************************************************
  208. ;*                                                        *
  209. ;*                  APPLICATION LEVEL CALLS                    *
  210. ;*                                                        *
  211. ;*******************************************************
  212.  
  213. ; ********************************************************
  214. ;* Component Database Add, Delete, and Query Routines 
  215. ;*******************************************************
  216.  
  217. ;
  218. ; pascal Component RegisterComponent(ComponentDescription *cd, ComponentRoutineUPP componentEntryPoint, short global, Handle componentName, Handle componentInfo, Handle componentIcon)
  219. ;
  220.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  221.         Macro
  222.         _RegisterComponent
  223.             moveq               #1,D0
  224.             dc.w                $A82A
  225.         EndM
  226.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  227.         IMPORT_CFM_FUNCTION RegisterComponent
  228.     ENDIF
  229.  
  230. ;
  231. ; pascal Component RegisterComponentResource(ComponentResourceHandle cr, short global)
  232. ;
  233.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  234.         Macro
  235.         _RegisterComponentResource
  236.             moveq               #18,D0
  237.             dc.w                $A82A
  238.         EndM
  239.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  240.         IMPORT_CFM_FUNCTION RegisterComponentResource
  241.     ENDIF
  242.  
  243. ;
  244. ; pascal OSErr UnregisterComponent(Component aComponent)
  245. ;
  246.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  247.         Macro
  248.         _UnregisterComponent
  249.             moveq               #2,D0
  250.             dc.w                $A82A
  251.         EndM
  252.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  253.         IMPORT_CFM_FUNCTION UnregisterComponent
  254.     ENDIF
  255.  
  256. ;
  257. ; pascal Component FindNextComponent(Component aComponent, ComponentDescription *looking)
  258. ;
  259.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  260.         Macro
  261.         _FindNextComponent
  262.             moveq               #4,D0
  263.             dc.w                $A82A
  264.         EndM
  265.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  266.         IMPORT_CFM_FUNCTION FindNextComponent
  267.     ENDIF
  268.  
  269. ;
  270. ; pascal long CountComponents(ComponentDescription *looking)
  271. ;
  272.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  273.         Macro
  274.         _CountComponents
  275.             moveq               #3,D0
  276.             dc.w                $A82A
  277.         EndM
  278.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  279.         IMPORT_CFM_FUNCTION CountComponents
  280.     ENDIF
  281.  
  282. ;
  283. ; pascal OSErr GetComponentInfo(Component aComponent, ComponentDescription *cd, Handle componentName, Handle componentInfo, Handle componentIcon)
  284. ;
  285.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  286.         Macro
  287.         _GetComponentInfo
  288.             moveq               #5,D0
  289.             dc.w                $A82A
  290.         EndM
  291.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  292.         IMPORT_CFM_FUNCTION GetComponentInfo
  293.     ENDIF
  294.  
  295. ;
  296. ; pascal long GetComponentListModSeed(void )
  297. ;
  298.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  299.         Macro
  300.         _GetComponentListModSeed
  301.             moveq               #6,D0
  302.             dc.w                $A82A
  303.         EndM
  304.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  305.         IMPORT_CFM_FUNCTION GetComponentListModSeed
  306.     ENDIF
  307.  
  308. ;
  309. ; pascal long GetComponentTypeModSeed(OSType componentType)
  310. ;
  311.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  312.         Macro
  313.         _GetComponentTypeModSeed
  314.             moveq               #44,D0
  315.             dc.w                $A82A
  316.         EndM
  317.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  318.         IMPORT_CFM_FUNCTION GetComponentTypeModSeed
  319.     ENDIF
  320.  
  321. ; ********************************************************
  322. ;* Component Instance Allocation and dispatch routines 
  323. ;*******************************************************
  324.  
  325. ;
  326. ; pascal OSErr OpenAComponent(Component aComponent, ComponentInstance *ci)
  327. ;
  328.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  329.         Macro
  330.         _OpenAComponent
  331.             moveq               #45,D0
  332.             dc.w                $A82A
  333.         EndM
  334.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  335.         IMPORT_CFM_FUNCTION OpenAComponent
  336.     ENDIF
  337.  
  338. ;
  339. ; pascal ComponentInstance OpenComponent(Component aComponent)
  340. ;
  341.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  342.         Macro
  343.         _OpenComponent
  344.             moveq               #7,D0
  345.             dc.w                $A82A
  346.         EndM
  347.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  348.         IMPORT_CFM_FUNCTION OpenComponent
  349.     ENDIF
  350.  
  351. ;
  352. ; pascal OSErr CloseComponent(ComponentInstance aComponentInstance)
  353. ;
  354.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  355.         Macro
  356.         _CloseComponent
  357.             moveq               #8,D0
  358.             dc.w                $A82A
  359.         EndM
  360.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  361.         IMPORT_CFM_FUNCTION CloseComponent
  362.     ENDIF
  363.  
  364. ;
  365. ; pascal OSErr GetComponentInstanceError(ComponentInstance aComponentInstance)
  366. ;
  367.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  368.         Macro
  369.         _GetComponentInstanceError
  370.             moveq               #10,D0
  371.             dc.w                $A82A
  372.         EndM
  373.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  374.         IMPORT_CFM_FUNCTION GetComponentInstanceError
  375.     ENDIF
  376.  
  377. ; ********************************************************
  378. ;*                                                        *
  379. ;*                      CALLS MADE BY COMPONENTS              *
  380. ;*                                                        *
  381. ;*******************************************************
  382.  
  383. ; ********************************************************
  384. ;* Component Management routines
  385. ;*******************************************************
  386.  
  387. ;
  388. ; pascal void SetComponentInstanceError(ComponentInstance aComponentInstance, OSErr theError)
  389. ;
  390.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  391.         Macro
  392.         _SetComponentInstanceError
  393.             moveq               #11,D0
  394.             dc.w                $A82A
  395.         EndM
  396.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  397.         IMPORT_CFM_FUNCTION SetComponentInstanceError
  398.     ENDIF
  399.  
  400. ;
  401. ; pascal long GetComponentRefcon(Component aComponent)
  402. ;
  403.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  404.         Macro
  405.         _GetComponentRefcon
  406.             moveq               #16,D0
  407.             dc.w                $A82A
  408.         EndM
  409.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  410.         IMPORT_CFM_FUNCTION GetComponentRefcon
  411.     ENDIF
  412.  
  413. ;
  414. ; pascal void SetComponentRefcon(Component aComponent, long theRefcon)
  415. ;
  416.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  417.         Macro
  418.         _SetComponentRefcon
  419.             moveq               #17,D0
  420.             dc.w                $A82A
  421.         EndM
  422.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  423.         IMPORT_CFM_FUNCTION SetComponentRefcon
  424.     ENDIF
  425.  
  426. ;
  427. ; pascal short OpenComponentResFile(Component aComponent)
  428. ;
  429.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  430.         Macro
  431.         _OpenComponentResFile
  432.             moveq               #21,D0
  433.             dc.w                $A82A
  434.         EndM
  435.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  436.         IMPORT_CFM_FUNCTION OpenComponentResFile
  437.     ENDIF
  438.  
  439. ;
  440. ; pascal OSErr OpenAComponentResFile(Component aComponent, short *resRef)
  441. ;
  442.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  443.         Macro
  444.         _OpenAComponentResFile
  445.             moveq               #47,D0
  446.             dc.w                $A82A
  447.         EndM
  448.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  449.         IMPORT_CFM_FUNCTION OpenAComponentResFile
  450.     ENDIF
  451.  
  452. ;
  453. ; pascal OSErr CloseComponentResFile(short refnum)
  454. ;
  455.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  456.         Macro
  457.         _CloseComponentResFile
  458.             moveq               #24,D0
  459.             dc.w                $A82A
  460.         EndM
  461.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  462.         IMPORT_CFM_FUNCTION CloseComponentResFile
  463.     ENDIF
  464.  
  465. ;
  466. ; pascal OSErr GetComponentResource(Component aComponent, OSType resType, short resID, Handle *theResource)
  467. ;
  468.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  469.         Macro
  470.         _GetComponentResource
  471.             moveq               #53,D0
  472.             dc.w                $A82A
  473.         EndM
  474.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  475.         IMPORT_CFM_FUNCTION GetComponentResource
  476.     ENDIF
  477.  
  478. ;
  479. ; pascal OSErr GetComponentIndString(Component aComponent, Str255 theString, short strListID, short index)
  480. ;
  481.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  482.         Macro
  483.         _GetComponentIndString
  484.             moveq               #54,D0
  485.             dc.w                $A82A
  486.         EndM
  487.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  488.         IMPORT_CFM_FUNCTION GetComponentIndString
  489.     ENDIF
  490.  
  491. ;
  492. ; pascal Component ResolveComponentAlias(Component aComponent)
  493. ;
  494.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  495.         Macro
  496.         _ResolveComponentAlias
  497.             moveq               #32,D0
  498.             dc.w                $A82A
  499.         EndM
  500.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  501.         IMPORT_CFM_FUNCTION ResolveComponentAlias
  502.     ENDIF
  503.  
  504. ; ********************************************************
  505. ;* Component Instance Management routines
  506. ;*******************************************************
  507.  
  508. ;
  509. ; pascal Handle GetComponentInstanceStorage(ComponentInstance aComponentInstance)
  510. ;
  511.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  512.         Macro
  513.         _GetComponentInstanceStorage
  514.             moveq               #12,D0
  515.             dc.w                $A82A
  516.         EndM
  517.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  518.         IMPORT_CFM_FUNCTION GetComponentInstanceStorage
  519.     ENDIF
  520.  
  521. ;
  522. ; pascal void SetComponentInstanceStorage(ComponentInstance aComponentInstance, Handle theStorage)
  523. ;
  524.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  525.         Macro
  526.         _SetComponentInstanceStorage
  527.             moveq               #13,D0
  528.             dc.w                $A82A
  529.         EndM
  530.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  531.         IMPORT_CFM_FUNCTION SetComponentInstanceStorage
  532.     ENDIF
  533.  
  534. ;
  535. ; pascal long GetComponentInstanceA5(ComponentInstance aComponentInstance)
  536. ;
  537.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  538.         Macro
  539.         _GetComponentInstanceA5
  540.             moveq               #14,D0
  541.             dc.w                $A82A
  542.         EndM
  543.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  544.         IMPORT_CFM_FUNCTION GetComponentInstanceA5
  545.     ENDIF
  546.  
  547. ;
  548. ; pascal void SetComponentInstanceA5(ComponentInstance aComponentInstance, long theA5)
  549. ;
  550.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  551.         Macro
  552.         _SetComponentInstanceA5
  553.             moveq               #15,D0
  554.             dc.w                $A82A
  555.         EndM
  556.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  557.         IMPORT_CFM_FUNCTION SetComponentInstanceA5
  558.     ENDIF
  559.  
  560. ;
  561. ; pascal long CountComponentInstances(Component aComponent)
  562. ;
  563.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  564.         Macro
  565.         _CountComponentInstances
  566.             moveq               #19,D0
  567.             dc.w                $A82A
  568.         EndM
  569.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  570.         IMPORT_CFM_FUNCTION CountComponentInstances
  571.     ENDIF
  572.  
  573. ;  useful helper routines for convenient method dispatching 
  574. ;
  575. ; pascal long CallComponentFunction(ComponentParameters *params, ComponentFunctionUPP func)
  576. ;
  577.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  578.         Macro
  579.         _CallComponentFunction
  580.             moveq               #-1,D0
  581.             dc.w                $A82A
  582.         EndM
  583.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  584.         IMPORT_CFM_FUNCTION CallComponentFunction
  585.     ENDIF
  586.  
  587. ;
  588. ; pascal long CallComponentFunctionWithStorage(Handle storage, ComponentParameters *params, ComponentFunctionUPP func)
  589. ;
  590.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  591.         Macro
  592.         _CallComponentFunctionWithStorage
  593.             moveq               #-1,D0
  594.             dc.w                $A82A
  595.         EndM
  596.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  597.         IMPORT_CFM_FUNCTION CallComponentFunctionWithStorage
  598.     ENDIF
  599.  
  600.     IF TARGET_CPU_PPC ** TARGET_OS_MAC THEN
  601. ;
  602. ; pascal long CallComponentFunctionWithStorageProcInfo(Handle storage, ComponentParameters *params, ProcPtr func, long funcProcInfo)
  603. ;
  604.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  605.         IMPORT_CFM_FUNCTION CallComponentFunctionWithStorageProcInfo
  606.     ENDIF
  607.  
  608.     ELSE
  609.     ENDIF
  610. ;
  611. ; pascal long DelegateComponentCall(ComponentParameters *originalParams, ComponentInstance ci)
  612. ;
  613.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  614.         Macro
  615.         _DelegateComponentCall
  616.             moveq               #36,D0
  617.             dc.w                $A82A
  618.         EndM
  619.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  620.         IMPORT_CFM_FUNCTION DelegateComponentCall
  621.     ENDIF
  622.  
  623. ;
  624. ; pascal OSErr SetDefaultComponent(Component aComponent, short flags)
  625. ;
  626.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  627.         Macro
  628.         _SetDefaultComponent
  629.             moveq               #30,D0
  630.             dc.w                $A82A
  631.         EndM
  632.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  633.         IMPORT_CFM_FUNCTION SetDefaultComponent
  634.     ENDIF
  635.  
  636. ;
  637. ; pascal ComponentInstance OpenDefaultComponent(OSType componentType, OSType componentSubType)
  638. ;
  639.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  640.         Macro
  641.         _OpenDefaultComponent
  642.             moveq               #33,D0
  643.             dc.w                $A82A
  644.         EndM
  645.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  646.         IMPORT_CFM_FUNCTION OpenDefaultComponent
  647.     ENDIF
  648.  
  649. ;
  650. ; pascal OSErr OpenADefaultComponent(OSType componentType, OSType componentSubType, ComponentInstance *ci)
  651. ;
  652.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  653.         Macro
  654.         _OpenADefaultComponent
  655.             moveq               #46,D0
  656.             dc.w                $A82A
  657.         EndM
  658.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  659.         IMPORT_CFM_FUNCTION OpenADefaultComponent
  660.     ENDIF
  661.  
  662. ;
  663. ; pascal Component CaptureComponent(Component capturedComponent, Component capturingComponent)
  664. ;
  665.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  666.         Macro
  667.         _CaptureComponent
  668.             moveq               #28,D0
  669.             dc.w                $A82A
  670.         EndM
  671.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  672.         IMPORT_CFM_FUNCTION CaptureComponent
  673.     ENDIF
  674.  
  675. ;
  676. ; pascal OSErr UncaptureComponent(Component aComponent)
  677. ;
  678.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  679.         Macro
  680.         _UncaptureComponent
  681.             moveq               #29,D0
  682.             dc.w                $A82A
  683.         EndM
  684.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  685.         IMPORT_CFM_FUNCTION UncaptureComponent
  686.     ENDIF
  687.  
  688. ;
  689. ; pascal long RegisterComponentResourceFile(short resRefNum, short global)
  690. ;
  691.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  692.         Macro
  693.         _RegisterComponentResourceFile
  694.             moveq               #20,D0
  695.             dc.w                $A82A
  696.         EndM
  697.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  698.         IMPORT_CFM_FUNCTION RegisterComponentResourceFile
  699.     ENDIF
  700.  
  701. ;
  702. ; pascal OSErr GetComponentIconSuite(Component aComponent, Handle *iconSuite)
  703. ;
  704.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  705.         Macro
  706.         _GetComponentIconSuite
  707.             moveq               #41,D0
  708.             dc.w                $A82A
  709.         EndM
  710.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  711.         IMPORT_CFM_FUNCTION GetComponentIconSuite
  712.     ENDIF
  713.  
  714.  
  715. ; ********************************************************
  716. ;*                                                        *
  717. ;*              Direct calls to the Components                *
  718. ;*                                                        *
  719. ;*******************************************************
  720.  
  721. ;  Old style names
  722.  
  723. ;
  724. ; pascal long ComponentFunctionImplemented(ComponentInstance ci, short ftnNumber)
  725. ;
  726.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  727.         Macro
  728.         _ComponentFunctionImplemented
  729.             move.l              #$0002FFFD,-(sp)
  730.             moveq               #0,D0
  731.             dc.w                $A82A
  732.         EndM
  733.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  734.         IMPORT_CFM_FUNCTION ComponentFunctionImplemented
  735.     ENDIF
  736.  
  737. ;
  738. ; pascal long GetComponentVersion(ComponentInstance ci)
  739. ;
  740.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  741.         Macro
  742.         _GetComponentVersion
  743.             move.l              #$0000FFFC,-(sp)
  744.             moveq               #0,D0
  745.             dc.w                $A82A
  746.         EndM
  747.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  748.         IMPORT_CFM_FUNCTION GetComponentVersion
  749.     ENDIF
  750.  
  751. ;
  752. ; pascal long ComponentSetTarget(ComponentInstance ci, ComponentInstance target)
  753. ;
  754.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  755.         Macro
  756.         _ComponentSetTarget
  757.             move.l              #$0004FFFA,-(sp)
  758.             moveq               #0,D0
  759.             dc.w                $A82A
  760.         EndM
  761.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  762.         IMPORT_CFM_FUNCTION ComponentSetTarget
  763.     ENDIF
  764.  
  765. ;  New style names
  766.  
  767. ;
  768. ; pascal ComponentResult CallComponentOpen(ComponentInstance ci, ComponentInstance self)
  769. ;
  770.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  771.         Macro
  772.         _CallComponentOpen
  773.             move.l              #$0004FFFF,-(sp)
  774.             moveq               #0,D0
  775.             dc.w                $A82A
  776.         EndM
  777.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  778.         IMPORT_CFM_FUNCTION CallComponentOpen
  779.     ENDIF
  780.  
  781. ;
  782. ; pascal ComponentResult CallComponentClose(ComponentInstance ci, ComponentInstance self)
  783. ;
  784.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  785.         Macro
  786.         _CallComponentClose
  787.             move.l              #$0004FFFE,-(sp)
  788.             moveq               #0,D0
  789.             dc.w                $A82A
  790.         EndM
  791.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  792.         IMPORT_CFM_FUNCTION CallComponentClose
  793.     ENDIF
  794.  
  795. ;
  796. ; pascal ComponentResult CallComponentCanDo(ComponentInstance ci, short ftnNumber)
  797. ;
  798.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  799.         Macro
  800.         _CallComponentCanDo
  801.             move.l              #$0002FFFD,-(sp)
  802.             moveq               #0,D0
  803.             dc.w                $A82A
  804.         EndM
  805.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  806.         IMPORT_CFM_FUNCTION CallComponentCanDo
  807.     ENDIF
  808.  
  809. ;
  810. ; pascal ComponentResult CallComponentVersion(ComponentInstance ci)
  811. ;
  812.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  813.         Macro
  814.         _CallComponentVersion
  815.             move.l              #$0000FFFC,-(sp)
  816.             moveq               #0,D0
  817.             dc.w                $A82A
  818.         EndM
  819.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  820.         IMPORT_CFM_FUNCTION CallComponentVersion
  821.     ENDIF
  822.  
  823. ;
  824. ; pascal ComponentResult CallComponentRegister(ComponentInstance ci)
  825. ;
  826.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  827.         Macro
  828.         _CallComponentRegister
  829.             move.l              #$0000FFFB,-(sp)
  830.             moveq               #0,D0
  831.             dc.w                $A82A
  832.         EndM
  833.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  834.         IMPORT_CFM_FUNCTION CallComponentRegister
  835.     ENDIF
  836.  
  837. ;
  838. ; pascal ComponentResult CallComponentTarget(ComponentInstance ci, ComponentInstance target)
  839. ;
  840.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  841.         Macro
  842.         _CallComponentTarget
  843.             move.l              #$0004FFFA,-(sp)
  844.             moveq               #0,D0
  845.             dc.w                $A82A
  846.         EndM
  847.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  848.         IMPORT_CFM_FUNCTION CallComponentTarget
  849.     ENDIF
  850.  
  851. ;
  852. ; pascal ComponentResult CallComponentUnregister(ComponentInstance ci)
  853. ;
  854.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  855.         Macro
  856.         _CallComponentUnregister
  857.             move.l              #$0000FFF9,-(sp)
  858.             moveq               #0,D0
  859.             dc.w                $A82A
  860.         EndM
  861.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  862.         IMPORT_CFM_FUNCTION CallComponentUnregister
  863.     ENDIF
  864.  
  865. ;
  866. ; pascal ComponentResult CallComponentGetMPWorkFunction(ComponentInstance ci, ComponentMPWorkFunctionUPP *workFunction, void **refCon)
  867. ;
  868.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  869.         Macro
  870.         _CallComponentGetMPWorkFunction
  871.             move.l              #$0008FFF8,-(sp)
  872.             moveq               #0,D0
  873.             dc.w                $A82A
  874.         EndM
  875.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  876.         IMPORT_CFM_FUNCTION CallComponentGetMPWorkFunction
  877.     ENDIF
  878.  
  879.  
  880.     IF ¬ TARGET_OS_MAC THEN
  881. ;  
  882. ;        CallComponent is used by ComponentGlue routines to manually call a component function.
  883. ;     
  884.  
  885. ;
  886. ; pascal ComponentResult CallComponent(ComponentInstance ci, ComponentParameters *cp)
  887. ;
  888.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  889.         IMPORT_CFM_FUNCTION CallComponent
  890.     ENDIF
  891.  
  892.     ENDIF
  893. ;  UPP call backs 
  894. ;  ProcInfos 
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.     ENDIF ; __COMPONENTS__ 
  902.  
  903.